<!DOCTYPE html>
<html>
<head>
    <title>register</title>
    <meta name="viewport" content="width=device-width, initial-scale=1"></meta>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
    <meta name="keywords" content=""></meta>
    <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
    <!-- //Custom Theme files -->
    <script src="http://cdn.bootcss.com/jquery/2.2.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/jquery.form/3.51/jquery.form.min.js"></script>
    <link href="http://cdn.bootcss.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"></link>
    <script src="http://cdn.bootcss.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    <link href="css/style.css" type="text/css" rel="stylesheet" media="all"></link>
    <!-- js -->

    <script src="js/simpleCart.min.js"> </script>
    <script src="js/logout.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            document.getElementById("username").focus();
            $("#loginForm").ajaxForm(function(data) {
                var returnJson;
                try {
                    returnJson = JSON.parse(data);
                    if (returnJson.state == 1) {
                        setTimeout("location.href = 'login'", 1000);
                    }
                } catch (e) {
                    alert("false");
                }
            });
        });
    </script>
</head>
<body>
<canvas id="canvas" style="position:absolute;z-index:-1;top:0px;left:0px"></canvas>
<div class="header">
    <div class="container">
        <nav class="navbar navbar-default" role="navigation" style="width:76%">
            <div class="navbar-header">
                <h1 class="navbar-brand"><a  href=".">DDBuy</a></h1>
            </div>
            <!--navbar-header-->

        </nav>
        <div class="header-info">
            <div class="header-right search-box">
                <a href="#"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></a>
                <div class="search">
                    <form class="navbar-form" action="products">
                        <input type="text" name="keyword" class="form-control"></input>
                        <input type="text" name="page" class="form-control" value="1" style="display:none"></input>
                        <button type="submit" class="btn btn-default" aria-label="Left Align">
                            搜索
                        </button>
                    </form>
                </div>
            </div>
            <div class="header-right login">
                <a href="order"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></a>
            </div>
            <div class="header-right cart">
                <a href="shopCart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span></a>
            </div>
            <div class="header-right cart" style="display: none;" id="logout">
                <a href="logout"><span class="glyphicon glyphicon-log-out" aria-hidden="true" ></span></a>
            </div>
        </div>
        <div class="clearfix"> </div>
    </div>
</div>

<div id="loginBox" style="width: 400px;">
    <form id="loginForm" action="user/register" method="post">
        <fieldset id="body">
            <fieldset>
                <label for="username">用户名</label>
                <input type="text" name="username" id="username" onfocus="true"></input>
            </fieldset>
            <fieldset>
                <label for="password">密码</label>
                <input type="password" name="password1" id="password1"></input>
            </fieldset>
            <fieldset>
                <label for="password">确认密码</label>
                <input type="password" name="password2" id="password2"></input>
            </fieldset>
            <br />
            <input type="submit" id="login" value="注册"></input>
        </fieldset>
    </form>
</div>

</body>
<script src="js/livephoto.js" type="text/javascript"></script>
</html>